package com.xiyuan.smartutils;

import com.xiyuan.smartutils.annotation.AnAlias;
import com.xiyuan.smartutils.logging.LogFactory;
import com.xiyuan.smartutils.logging.Logger;

/**
 * 日志输出工具类
 * 1、用于Logs.info();方式直接打印日志
 * 2、用于远程或浏览器RMI/AJAX打印日志
 *
 * @version v1.0.0 @author lgz 2017-7-31 新建与整理
 */
@AnAlias("Logs")
public class Logs
{
    private static final Logger log = LogFactory.getLogger(Logs.class);
    
    /******************************************************/
    //调试
    /******************************************************/
 
    public static void debug(Object message)
    {
        log.debug(message);
    }
    
    public static void debug(Throwable throwable)
    {
        log.debug(throwable);
    }
    
    public static void debug(Object message, Object... arguments)
    {
        log.debug(message, arguments);
    }
    
    public static void debug(Object message, Throwable throwable, Object... arguments)
    {
        log.debug(message, throwable, arguments);
    }
    
    /******************************************************/
    //信息
    /******************************************************/
    
    public static void info(Object message)
    {
        log.info(message);
    }
    
    public static void info(Throwable throwable)
    {
        log.info(throwable);
    }
    
    public static void info(Object message, Object... arguments)
    {
        log.info(message, arguments);
    }
    
    public static void info(Object message, Throwable throwable, Object... arguments)
    {
        log.info(message, throwable, arguments);
    }
    
    /******************************************************/
    //错误
    /******************************************************/
    
    public static void error(Object message)
    {
        log.error(message);
    }
    
    public static void error(Throwable throwable)
    {
        log.error(throwable);
    }
    
    public static void error(Object message, Object... arguments)
    {
        log.error(message, arguments);
    }
    
    public static void error(Object message, Throwable throwable, Object... arguments)
    {
        log.error(message, throwable, arguments);
    }
    
    /******************************************************/
    //后端警告
    /******************************************************/
    
    public static void warn(Object message)
    {
        log.warn(message);
    }
    
    public static void warn(Throwable throwable)
    {
        log.warn(throwable);
    }
    
    public static void warn(Object message, Object... arguments)
    {
        log.warn(message, arguments);
    }
    
    public static void warn(Object message, Throwable throwable, Object... arguments)
    {
        log.warn(message, throwable, arguments);
    }
    
    // /******************************************************/
    // //后台危急错误
    // /******************************************************/
    //
    // public static void fatal(Object message)
    // {
    //     log.fatal(message);
    // }
    //
    // public static void fatal(Throwable throwable)
    // {
    //     log.fatal(throwable);
    // }
    //
    // public static void fatal(Object message, Object... arguments)
    // {
    //     log.fatal(message, arguments);
    // }
    //
    // public static void fatal(Object message, Throwable throwable, Object... arguments)
    // {
    //     log.fatal(message, throwable, arguments);
    // }
}
